import Vue from 'vue'

const axios = Vue.$axios

export const GetListRole = () => {
    return axios({
        url: '/roles',
        method: 'get'
    })
}

export const GetOneRole = (id) => {
    return axios({
        url: '/roles/' + id,
        method: 'get'
    })
}

export const CreateOneRole = (data) => {
    return axios({
        url: '/roles',
        method: 'post',
        data: data
    })
}

export const UpdateOneRole = (data) => {
    return axios({
        url: '/roles' + "/" + data.id,
        method: 'put',
        data: data
    })
}

export const RemoveOneRole = (id) => {
    return axios({
        url: '/roles/' + id,
        method: 'delete',
    })
}